package com.dk.service.impl;
import com.dk.mapper.UserMapper;
import com.dk.pojo.User;
import com.dk.pojo.UserExample;
import com.dk.service.UserServiceI;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserServiceI {

    @Resource
    private UserMapper userMapper;

    @Override
    public User selectGetAll(String uname) {
        UserExample example = new UserExample();
        UserExample.Criteria criteria = example.createCriteria();
        criteria.andUnameEqualTo(uname);
        List<User> list = userMapper.selectByExample(example);
        return (list == null || list.size() <= 0) ? null : list.get(0);
    }
}
